Image coding technology has been applied to many familiar video appliances, ranging from television sets to cellular phones which are capable of image processing.
In the field of image coding technology, generally, image data (image information) is divided into a plurality of blocks, orthogonally transformed every divided block. The acquired transform coefficients are quantized and then the quantized transform coefficients are coded by variable-length coding. In this coding method, image degradation occurs due to loss of information during quantization. In particular, serious degradation is prone to occur in images by large distortion (so-called block noise) that generates at the boundaries between individual blocks as the units for implementation of orthogonal transformation. Once a block noise arises at the boundary of each block in the image coding process, block noise also arises when the coded image is decoded so that a user who views the image is liable to feel unnatural. Thus, in order to remove the block noise, block noise arising at the boundary of each block is subjected to a filtering process in a typical image decoding apparatus (or image coding apparatus).
For example, non-patent document 1 discloses a basic filter processing technique. The filter processing technique disclosed in non-patent document 1 will be described hereinbelow with reference to FIG. 26. FIG. 26 is a diagram schematically showing pixels and the pixel values of the corresponding pixels around a block boundary.
It is assumed in FIG. 26 that a block boundary is present between a pixel P0 with a pixel value of p0 and a pixel Q0 with a pixel value of q0 while pixels P1, P2 and P3 and pixels Q1, Q2 and Q3 are located in the order as they go away from the boundary. Also these pixels are assumed to have pixel values p1, p2 and p3 and pixel values q1, q2 and q3, respectively.
In other words, in FIG. 26, among two blocks adjacent to each other along a block boundary, the pixel values of one block are represented by pixel values pk (k is a value defined by the distance from the boundary) while the pixel values of the other block are represented by pixel values qk (k is a value defined by the distance from the boundary). Note that, in FIG. 26, no distinction is made between the boundary in the horizontal direction and the boundary in the vertical direction.
Further, though non-patent document 1 discloses a plurality of filtering processes, in this specification an example of a filter processing using a mode called BS=4 will be described.
In BS=4, the following formula (0-1) and formula (0-2) are used to calculate values “d” and “ap” that represent the conditions of the boundary.d=ABS(p0−q0)  (0-1)ap=ABS(p2−q0)  (0-2)
Then, when the calculated “d” and “ap” satisfy d<α and ap<β, for α and β being predetermined thresholds, the following filtering process is effected:—p0′=(p2+2×p1+2×p0+2×q0+q1)/8p1′=(p2+p1+p0+q0)/4p2′=(2×p3+3×p2+p1+p0+q0)/8.
Otherwise, the following filtering is implemented:—p0′=(2×p1+p0+q0)/4
In this way, in this technique, the number of taps and coefficients of the filter and the filtering range are varied depending on the magnitude ap of the gradient around the block boundary so as to be able to adaptively modify the strength.
Since a deblocking filter is basically a low-pass filter, the effect of removing block distortion becomes greater the greater the number of taps in the filter and the wider the coverage of the filter is. However, in this case, the image tends to become blurred conversely. Accordingly, it is desired to provide a configuration in which the strength of the filter can be controlled depending on the preferences of the creator or viewer of the movie.
In the technology of non-patent document 1, the degree of filtering can be controlled by adding thresholds α and β that control switching of filtering process to a slice header as the information for controlling a slice having a plurality of macro blocks bundled and sending the slice header.